<extend name="Public:base"/>

<block name="main">
<load href="__JS__/swfupload.js"/>
<div id="yzh-content" class="col-xs-12">
    <div class="main-title">
        <h2>在线客服</h2>
    </div>

    <div class="row">
        <div class="col-md-8">
            <div class="table-actions">
                <a href="{:U('Kefu/add')}" class="btn btn-sm btn-primary">添加</a>
                <a class="btn btn-sm btn-primary" onclick="myform.action='{:U('Kefu/listorder')}';$('#myform').submit();">排序</a>

            </div>
            <form name="myform" id="myform" action="" method="post">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr>
                        <th width="30"><input type="checkbox" value="" id="check_box" onclick="selectall('ids[]');"></th>
                        <th class="w-50">排序</th>
                        <th>名称</th>
                        <th>类别</th>
                        <th>代码</th>
                        <th>管理操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="list" id="vo" key="k">
                        <tr>
                            <td  width="30" align="center"><input class="inputcheckbox" name="ids[]" value="{$vo['id']}" type="checkbox" ></td>
                            <td width="40" align='center'><input name='listorders[{$vo.id}]' type='text' size='3' value='{$vo.listorder}' class='input-text-c'></td>

                            <td>{$vo['name']}</td>
                            <td>{$vo['type']|fieldoption=$fields['type'],###}</td>
                            <td>
                                {$vo['code']|stripcslashes}
                            </td>
                            <td>
                                <a class="btn btn-xs btn-primary" href="{:U('Kefu/edit',array('id'=>$vo['id']))}">编辑</a>
                                <a class="btn btn-xs btn-danger" href="javascript:confirm_delete('{:U('Kefu/delete',array(id=>$vo['id']))}')">删除</a>
                            </td>
                        </tr>
                    </volist>
                    </tbody>
                </table>

                <div class="row">
                    <div class="pull-right" id="pages">{$page}</div>
                </div>

            </form>
        </div>

        <div class="col-md-4">
            <div class="panel panel-default">
                <div class="panel-heading">二维码</div>
                <form method="post" id="qr_form" action="{:U('config/dosite')}">
                    <div class="panel-body">

                        <input type="hidden" name="lang" value="{$langid}"/>
                        <input type="hidden" id="site_wzqrcode" name="site_wzqrcode" value="{$site_wzqrcode}" size="40" />
                        <div class="thumb_box" style ="left:500px;width:97px;height:130px;padding:2px;top:-7px;"><div id="image_aid_box"></div>
                            <a href="javascript:swfupload('logo_uploadfile','site_wzqrcode','{:L(uploadfiles)}',1,1,0,1,'jpeg,jpg,png,gif',3,1,'{$yzh_auth}',yesdo,nodo)">
                                <img style="width:100px;height: 100px;" src="<if condition="!empty($site_wzqrcode)">{$site_wzqrcode}<else/>__IMG__/admin_upload_thumb.png</if>" id="site_wzqrcode_pic" ></a><br>
                            <input type="button" value="取消图片" onclick="javascript:clean_thumb('site_wzqrcode');" class="btn btn-xs btn-info" style="margin:0;" />
                        </div>(建议尺寸：100px*100px)
                    </div>
                    <div class="panel-footer">
                        <input type="submit" value="保存" class="btn btn-sm btn-primary" >
                        <input type="reset" value="重置" class="btn btn-sm btn-primary">
                    </div>
                </form>
            </div>

        </div>
    </div>

</div>
<script type="text/javascript">
    $(document).ready(function() {
        $('#qr_form').ajaxForm({
            success:  complete,  // post-submit callback
            dataType: 'json'
        });
    });

    function complete(data){
        if(data.status==1){
            $.scojs_message('修改成功', $.scojs_message.TYPE_OK);
        }else{
            $.scojs_message(data.info, $.scojs_message.TYPE_ERROR);
        }

    }
</script>
</block>